package day9;

import day5.Sex;
import day5.Student;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * @author oldliu
 * @since 1.0
 */
public class StoreStduent {
    public static void main(String[] args) {
        Student d=new Student();
        d.setName("刘贵哼");
        d.setSex(Sex.男);
        try {
            ObjectOutputStream oout=new ObjectOutputStream(new FileOutputStream("student.obj"));
            oout.writeObject(d);
            oout.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
